<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>收款码</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<style>
		.layui-imgbox .layui-imgbox-close{z-index: 6;}
	</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
			<div class="layui-card-header"><i class="fa fa-cog"></i> 收款码</div>
			<div class="layui-card-body" pad15>
				<div class="layui-form form-label-w8" lay-filter="">
					<div class="layui-form-item">
						<label class="layui-form-label">二维码：</label>
						<div class="layui-input-inline">
							<div style="width:100%;margin:10px 0" id="urlqr"></div>
							<div style="width:100%;text-align:center"><button class="layui-btn layui-btn-sm layui-btn-primary" onclick="showwxqrcode('pagesB/maidan/pay?bid={$bid}')">查看小程序码</button></div>
						</div>
						<div class="layui-form-mid"></div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">链接地址：</label>
						<div class="layui-form-mid" style="width: 500px;">
							{$Think.const.PRE_URL2}/h5/{$aid}.html#/pagesB/maidan/pay?bid={$bid}
							<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="copyText('{$Think.const.PRE_URL2}/h5/{$aid}.html#/pagesB/maidan/pay?bid={$bid}')">复制</button>
						</div>
						<div class="layui-form-mid"></div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">页面路径：</label>
						<div class="layui-form-mid" style="width: 500px;">
							pagesB/maidan/pay?bid={$bid}
							<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="copyText('pagesB/maidan/pay?bid={$bid}')">复制</button>
						</div>
						<div class="layui-form-mid"></div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">支付后跳转：</label>
						<div class="layui-input-inline" style="width:300px">
							<input type="text" name="maidan_payaftertourl" class="layui-input" value="{$admin.maidan_payaftertourl}" id="maidan_payaftertourl">
						</div>
						<div class="layui-btn layui-btn-primary" style="float:left" onclick="chooseUrl2('maidan_payaftertourl')">选择链接</div>
						<div class="layui-form-mid layui-word-aux"></div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label"></label>
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="maidanedit">保存</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
  </div>
	{include file="public/js"/}
	<script>
		url = '{$Think.const.PRE_URL2}/h5/{$aid}.html#/pagesB/maidan/pay?bid={$bid}';
		var qrcode = new QRCode('urlqr', {
			text: 'your content',
			width: 200,
			height: 200,
			colorDark : '#000000',
			colorLight : '#ffffff',
			correctLevel : QRCode.CorrectLevel.L
		});
		qrcode.clear();
		qrcode.makeCode(url);

		layui.form.on('submit(maidanedit)', function(obj){
			var field = obj.field
			$.post("{:url('save')}",obj.field,function(data){
				dialog(data.msg,data.status);

			})
		})
		layui.upload.render({
			elem: '#uploadjstxt', //绑定元素
			url: "{:url('uploadjstxt')}", //上传接口
			exts:'txt|html',
			accept:'file',
			done: function(res){
				//上传完毕回调
				console.log(res)
				dialog(res)
			},
			error: function(){
				//请求异常回调
			}
		});
		layui.form.on('radio(maidan_login)', function(data){
			if(data.value=='1'){
				$('#auto_reg').hide();
			}else{
				$('#auto_reg').show();
			}
		})
		var chooseUrlField = '';
		function chooseUrl2(field){
			chooseUrlField = field;
			layer.open({type:2,shadeClose:true,area:['1200px', '650px'],'title':'选择链接',content:"{:url('DesignerPage/chooseurl')}&callback=chooseLink2"})
		}
		function chooseLink2(urlname,url){
			$("#"+chooseUrlField).val(url);
		}
  </script>
	{include file="public/copyright"/}
</body>
</html>